1. Technology Field
The present invention generally relates to a memory management table processing method, and more particularly, to a memory management table processing method for writing data streams belonging to a memory management table into a buffer memory and reading data streams belonging to the memory management table from the buffer memory, and a memory controller and a memory storage apparatus using the same.
2. Description of Related Art
Along with the widespread of digital cameras, cell phones, and MP3 in recently years, the consumers' demand to storage media has increased drastically. Rewritable non-volatile memory is one of the most adaptable storage media to portable electronic products (for example, cell phones, personal digital assistants (PDAs), and notebook computers) due to its many characteristics such as data non-volatility, low power consumption, small volume, non-mechanical structure, and high access speed. For example, a solid state drive (SSD) is a storage apparatus which uses a flash memory as its storage medium. Thus, in recent years, the flash memory industry has become a major part of the electronic industry.
A rewritable non-volatile memory module has a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages. While writing data into a physical block, the data has to be written according to the sequence of the physical pages. In addition, a physical page containing data has to be erased before it is used for writing new data. In particular, each physical block is the smallest erasing unit, and each physical page is the smallest programming (i.e., writing) unit.
In order to improve the operation efficiency, a memory controller of a flash memory storage apparatus groups the physical blocks of a flash memory module into a data area, a free area, a system area, and a replacement area.
Physical blocks in the data area are used for storing data written by a host system. To be specific, a memory controller converts a logical access address accessed by the host system into a logical page of a logical block and maps the logical page of the logical block to a physical page of a physical block in the data area. Namely, in the management of a flash memory module, the physical blocks in the data area are considered used physical blocks (for example, already containing data written by a host system). Additionally, the memory controller records the mapping relationship between the logical blocks and the physical blocks in the data area in a logical block-physical block mapping table, wherein the logical pages of each logical block are sequentially mapped to the physical pages of the corresponding physical block.
Physical blocks in the free area are used for substituting the physical blocks in the data area. To be specific, a physical block already containing data has to be erased before it is used for writing new data, while a physical block in the free area is used for writing updated data and substituting the physical block originally mapped to a logical block. Accordingly, the physical blocks in the free area are either blank blocks or usable blocks (i.e., no data is recorded therein or data recorded therein is already marked as invalid data).
Physical blocks in the system area are used for recording system data, such as the manufacturer and model of the flash memory module, the number of physical blocks in the flash memory module, and the number of physical pages in each physical block.
Physical blocks in the replacement area are used for replacing damaged physical blocks. To be specific, if there are still normal physical blocks in the replacement area and a physical block in the data area is damaged, the memory management circuit selects a normal physical block from the replacement area to replace the damaged physical block.
In order to deal with complicated management operations while managing the flash memory module, the memory controller usually uses many memory management tables for recording information related to the physical blocks. In particular, during the operation of the flash memory storage apparatus, the memory management tables are temporarily stored in a buffer memory to be updated. These memory management tables may include a logical block-physical block mapping table, a free area physical block table, a replacement area physical block table, a system area physical block table, a bad block table, and an erasing count table, etc. Along with the increase in the complicacy of management logic, the number of memory management tables to be used by the memory controller also increases and accordingly more and more storage space in the buffer memory will be taken. However, since the buffer memory offers only a limited storage space, how to efficiently utilize the storage space of the buffer memory has become one of the major subjects in the industry.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.